import React from 'react';
import { formatMessage, setLocale, getLocale } from 'umi-plugin-locale';
import {ButtonComp, SiderMenu, GlobalProvider} from 'jh-lib';
import {Layout} from 'antd'

const localeUtils = {

};
const menuData = [
    {
        icon: 'database',
        name: '导航信息',
        en: 'Navigation',
        key: '/nav',
        path: '/nav',
    },
    {
        icon: 'database',
        name: 'test1交叉表',
        en: 'Supplementary cross statement',
        key: '/suppCross',
        path: '/suppCross',
    },
    {
        icon: 'database',
        name: 'test2列表',
        en: 'Supplementary statement',
        key: '/suppList',
        path: '/suppList',
    },

];
const location = {
    pathname:'nav'
}
export default class Test extends React.Component{
    state={
        collapsed:false
    };
    onCollapse(){
        this.setState({
            collapsed:!this.state.collapsed
        })
    }
    render(){
        return (
            <>
                <GlobalProvider localeUtils={localeUtils}>
                    <Layout>
                        <SiderMenu
                            title='测试 - test1'
                            // fixSiderbar={true}
                            collapsed={this.state.collapsed}
                            theme='dark'
                            menuData={menuData}
                            location={
                                location
                            }
                        />
                        <ButtonComp onClick={this.onCollapse.bind(this)}>
                            {
                                this.state.collapsed ? '展开':'关闭'
                            }
                        </ButtonComp>
                    </Layout>
                </GlobalProvider>

            </>)
    }
}
